package com.gitee.openviducn.inspector.enums;

import lombok.Getter;

/**
 * 相关文档：<br>
 * <a href="http://openvidu_cn.gitee.io/openvidu_docs_cn/docs/reference-docs/openvidu-server-cdr/">
 *  OpenVidu Server CDR 通话细节记录
 * </a>
 *
 * @Author: https://gitee.com/wesleyOne
 * @Date: 02.29 2020
 */
@Getter
public enum  CDRReasonEnum {

    /**
     * sessionDestroyed     会话销毁
     *
     *     "lastParticipantLeft"，
     *     "sessionClosedByServer"，
     *     "openviduServerStopped"，
     */
    LAST_PARTICIPANT_LEFT("lastParticipantLeft","最后一个参与者离开"),
    SESSION_CLOSED_BY_SERVER("sessionClosedByServer","服务端关闭会话"),
    OPENVIDU_SERVER_STOPPED("openviduServerStopped","openvidu服务停止"),


    /**
     * participantLeft      参与者离开
     *
     *     "disconnect",
     *     "forceDisconnectByUser",
     *     "forceDisconnectByServer",
     *     "sessionClosedByServer",
     *     "networkDisconnect",
     *     "openviduServerStopped"
     */
    DISCONNECT("disconnect","断开连接"),
    FORCE_DISCONNECT_BY_USER("forceDisconnectByUser","用户强制断开连接"),
    FORCE_DISCONNECT_BY_SERVER("forceDisconnectByServer","服务端强制断开连接"),
    NETWORK_DISCONNECT("networkDisconnect","网络断开连接"),


    /**
     *  webrtcConnectionDestroyed WebRTC连接销毁
     *
     *      "unsubscribe",
     *      "unpublish",
     *      "disconnect",
     *      "forceUnpublishByUser",
     *      "forceUnpublishByServer",
     *      "forceDisconnectByUser",
     *      "forceDisconnectByServer",
     *      "sessionClosedByServer",
     *      "networkDisconnect",
     *      "openviduServerStopped",
     *      "mediaServerDisconnect"
     */
    UNSUBSCRIBE("unsubscribe","取消订阅"),
    UNPUBLISH("unpublish","取消发布"),
    FORCE_UNPUBLISH_BY_USER("forceUnpublishByUser","用户强制取消发布"),
    FORCE_UNPUBLISH_BY_SERVER("forceUnpublishByServer","服务端强制取消发布"),
    MEDIA_SERVER_DISCONNECT("mediaServerDisconnect","媒体服务断开连接"),

    /**
     *  recordingStatusChanged 录制状态变更
     *  录制状态变更的原因，只有状态是 stopped 或者 ready 时才存在
     *
     *      "recordingStoppedByServer",
     *      "lastParticipantLeft",
     *      "sessionClosedByServer",
     *      "automaticStop",
     *      "openviduServerStopped",
     *      "mediaServerDisconnect"
     */
    RECORDING_STOPPED_BY_SERVER("recordingStoppedByServer","服务端停止录制"),
    AUTOMATIC_STOP("automaticStop","自动停止"),

    ;
    private String code;
    private String desc;
    CDRReasonEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
}
